import Vapor
import Fluent

final class Reference: Model, Content {
    static let schema: String = "reference"
    
    @ID
    var id: UUID?

    @Field(key: "referenceTitle")
    var referenceTitle: String?
    
    @Field(key: "rbm")
    var rbm: String
    
    @Field(key: "countryIso")
    var countryIso: String?
    
    @Field(key: "projectNumbers")
    var projectNumbers: String?
    
    @Field(key: "latitude")
    var latitude: Double
    
    @Field(key: "longitude")
    var longitude: Double
    
    @Field(key: "coordinateIsExact")
    var coordinateIsExact: Bool
    
    @Field(key: "hasImages")
    var hasImages: Bool
    
    @Field(key: "hasVideos")
    var hasVideos: Bool
    
    @Field(key: "isBreederSystems")
    var isBreederSystems: Bool
    
    @Field(key: "isBroilerSystems")
    var isBroilerSystems: Bool
    
    @Field(key: "isCageFreeSystems")
    var isCageFreeSystems: Bool
    
    @Field(key: "isConventionalLayerSystems")
    var isConventionalLayerSystems: Bool
    
    @Field(key: "isEnrichedCages")
    var isEnrichedCages: Bool
    
    @Field(key: "isManureHandling")
    var isManureHandling: Bool
    
    @Field(key: "mainImageFileOcId")
    var mainImageFileOcId: String
    
    @Field(key: "locationName")
    var locationName: String
    
    @Field(key: "mainTestimonialImageFileOcId")
    var mainTestimonialImageFileOcId: String
    
    @Field(key: "additionalInformation")
    var additionalInformation: String
    
    @Children(for: \.$reference)
    var texts: [ReferenceText]
    
    @Children(for: \.$reference)
    var images: [ReferenceImage]
    
    @Children(for: \.$reference)
    var referenceVideos: [ReferenceVideo]
    
}
